home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 April: Mac OS SDK / Dev.CD Apr 00 SDK1.toast / Development Kits / Mac OS / Thread Manager / Sample Applications / 68k Examples / Single Intersection Threads / UApplication.p < prev    next >
Encoding:
Text File  |  1994-11-17  |  2.6 KB  |  126 lines  |  [TEXT/MPS ]

  1. {–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
  2.  
  3.     PROJECT:        Threads Traffic Simulation
  4.     
  5.     FILE:            UApplication.p
  6.     
  7.     LANGUAGE:        MPW Pascal (version 3.2)
  8.         
  9.     DESCRIPTION:    This is the declaration area for all application variables and constants.
  10.                     If possible, no procedures or functions should be put here.
  11.         
  12.     AUTHOR(S):        William H. Knott
  13.                     Apple Computer
  14.                     Cupertino, CA  95014
  15.                     AppleLink : KNOTT
  16.     
  17.     VERSION(S):        1.0        13-Oct-91    WHK    Brand New Today.
  18.  
  19. –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––}
  20.  
  21. UNIT UApplication;
  22.  
  23. INTERFACE
  24.  
  25. USES
  26.     MemTypes, QuickDraw, OSIntf, ToolIntf, PackIntf, Traps;
  27.  
  28.  
  29. TYPE
  30.     
  31.     TrafficLight    = RECORD
  32.         lightState            : INTEGER;
  33.         phaseTimes            : ARRAY[0..3] OF INTEGER;    { In Seconds!    }
  34.         dispStateChanged    : BOOLEAN;
  35.     END;
  36.     
  37.     AutoHandle    = ^AutoPtr;
  38.     AutoPtr        = ^AutoRec;
  39.     AutoRec    = RECORD
  40.         carType                : INTEGER;
  41.         direction            : INTEGER;
  42.         speed                : Real;
  43.         accelleration        : Real;
  44.         braking                : Real;
  45.         turning                : BOOLEAN;
  46.         position            : POINT;
  47.         needToRedraw        : BOOLEAN;
  48.         recalcCarShape        : BOOLEAN;
  49.         carIsDone            : BOOLEAN;
  50.         oldTrapAddr            : Handle;
  51.         markedForDeath        : BOOLEAN;
  52.     END;    
  53.     
  54.     AutoListArrayHdl    = ^AutoListArrayPtr;
  55.     AutoListArrayPtr    = ^AutoListArray;
  56.     AutoListArray        = ARRAY[1..MaxInt] OF AutoHandle;
  57.  
  58.  
  59. CONST    
  60.     
  61.     rAboutDlogID             = 1024;
  62.     rNotYetImplementedID    = 1025;    
  63.  
  64.     rNoThreadMgrAlertID        = 2048;    
  65.     
  66.     kNewWindow                = 1024;
  67.     
  68.     rMenuBarID                 = 1024;
  69.     
  70.     rClipboardWindow        = 1000;
  71.     
  72.     rAppleMenuID            = 128;
  73.         iAboutItem            = 1;
  74.     
  75.     rFileMenuID            = 129;
  76.         iFileNewItem        = 1;
  77.         iFileOpenItem        = 2;
  78.         iFileCloseItem        = 4;
  79.         iFileSaveItem        = 5;
  80.         iFileSaveAsItem        = 6;
  81.         iFileRevertItem        = 7;
  82.         iFilePSetupItem        = 9;
  83.         iFilePrintItem        = 10;
  84.         iFileQuitItem        = 12;
  85.     
  86.     rEditMenuID            = 130;
  87.         iEditUndoItem        = 1;
  88.         iEditCutItem        = 3;
  89.         iEditCopyItem        = 4;
  90.         iEditPasteItem        = 5;
  91.         iEditClearItem        = 6; 
  92.         iShowClipboard        = 8; 
  93.     
  94.     rTestMenuID            = 131;
  95.         iTest1Item            = 1;
  96.         iTest2Item            = 2;
  97.         iTest3Item            = 3;
  98.         iTest4Item            = 4;
  99.         iTest5Item            = 5;
  100.     
  101.     kLightState1Time        = 1;
  102.     kLightState2Time        = 2;
  103.     kLightState3Time        = 3;
  104.     kLightState4Time        = 4;
  105.     kLightState5Time        = 5;
  106.     kLightState6Time        = 6;
  107.     kLightState7Time        = 7;
  108.     kLightState8Time        = 8;
  109.     
  110.     kColorOne                = BlueColor;
  111.     kColorTwo                = redColor;
  112.     kColorThree                = magentaColor;
  113.     kColorFour                = GreenColor;
  114.     
  115.  
  116. VAR
  117.     gIntoCooperativeWind    : WindowPtr;
  118.     gClipBoard                : WindowPtr;
  119.     gDone                    : BOOLEAN;
  120.     gAutomobiles            : AutoListArrayHdl;
  121.     gTrafficState            : TrafficLight;
  122.     gCurrentTime            : LONGINT;
  123.     
  124. IMPLEMENTATION
  125.  
  126. END.